<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="portal.vo.*" %>
<%@page import="java.util.*" %> 
<%
List<ItemVO> items = new ArrayList<ItemVO>();
if(request.getAttribute("listaCarrito") != null) 
	items = (List<ItemVO>)request.getAttribute("listaCarrito");

double cartTotal = 0;
for(ItemVO it: items)
	cartTotal = cartTotal + (it.getItemProducto().getPrecio().doubleValue() * it.getCantidad());
%>
    
<div style="width:180px">
	Carrito de Compras
</div>
<div style="width:180px">
	<div style="padding:5px; text-align:left">
		<div style="float:right"><%=cartTotal %> $</div>
		<div style="float:left"><%=items.size() %> producto<%=(items.size()>1?"s":"") %></div>
		<div class="clear">&nbsp;</div>
		
		 <span class="ajax" onClick="requestContent('/PortalWeb/ObtenerListaCarritoServlet')">Ver mi carrito</span><br>
		 <span class="ajax" onClick="requestContent('/PortalWeb/CheckoutServlet')">Comprar</span>
	</div>
</div>